<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/8/18
 * Time: 15:39
 */
namespace  app\admin\controller;
use think\Controller;
use think\captcha\Captcha;
use think\Request;

class Base extends  Controller {
    public function  __construct(Request $request)
    {
        parent::__construct($request);
    }

    protected function islogin(){
        return $this->getUser() ? true : false;
    }
    protected function getUser()
    {
        return session('user');
    }
    /**
     * 验证二维码
     */
    protected  function  checkcaptcha($code){
        $Captcha = new Captcha();
        return $Captcha->check($code);
    }

}